# Contributor: Rasmus Thomsen <oss@cogitri.dev>
# Contributor: Krassy Boykinov <kboykinov@teamcentrixx.com>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=xdg-desktop-portal-gtk
pkgver=1.15.1
pkgrel=1
pkgdesc="Gtk implementation of xdg-desktop-portal"
url="https://github.com/flatpak/xdg-desktop-portal-gtk"
arch="all"
license="LGPL-2.1-or-later"
depends="
	gsettings-desktop-schemas
	xdg-desktop-portal
	"
makedepends="
	dbus-dev
	gnome-desktop-dev
	gtk+3.0-dev
	meson
	xdg-desktop-portal-dev
	"
subpackages="$pkgname-lang"
source="https://github.com/flatpak/xdg-desktop-portal-gtk/releases/download/$pkgver/xdg-desktop-portal-gtk-$pkgver.tar.xz"
options="!check"  # no tests provided

case "$CARCH" in
s390x|armhf)
	# no gnome shell
	;;
*)
	makedepends="$makedepends gnome-shell"
	;;
esac

build() {
	abuild-meson \
		-Db_lto=true \
		-Dappchooser=enabled \
		-Ddatarootdir=/usr/lib/pkgconfig \
		-Ddbus-service-dir=/usr/share/dbus-1/services/ \
		-Dlockdown=enabled \
		-Dsettings=enabled \
		-Dwallpaper=auto \
		. output
	meson compile -C output
}

package() {
	DESTDIR="$pkgdir" meson install --no-rebuild -C output
	rm -rf "$pkgdir"/usr/lib/systemd
}

sha512sums="
21c0165b8bc86dc8f5c1e0bca512fab8ef303a14fed7753b5d5c8f81c20967102e651ae4fb951a203e581deecd012d4061abe6a69261704263a15573aea62489  xdg-desktop-portal-gtk-1.15.1.tar.xz
"
